﻿using Demo.Application.Services.User;
using PmSoft.Core.EventBus;

namespace Demo.Application.Events;

public class UserCreatedEventHandler : IAsyncEventHandler<UserCreatedEventArgs>
{
	private readonly UserService userService;
	public UserCreatedEventHandler(UserService userService)
	{
		this.userService = userService;
	}

	public async Task HandleAsync(UserCreatedEventArgs args)
	{
		var user = await userService.GetUserAsync(100);
		await Task.Delay(new Random().Next(10000,2000));
	}
}
